<div class="header">
    <h1 class="page-title">食品列表</h1>
</div>
<ul class="breadcrumb">
    <li><a ui-sref="main">Home</a> <span class="divider">/</span></li>
    <li class="active">Index</li>
</ul>

<div class="container-fluid">
    <div class="row-fluid">
        <div class="btn-toolbar">
            <button ui-sref="food_add" type="button" class="btn btn-primary"><i class="icon-plus"></i>添加食品</button>
        </div>
        <div class="well">
            <table class="table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>食品名称</th>
                    <th>价格</th>
                    <th>时间</th>
                    <th>所属分类</th>
                    <th style="width: 50px;">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in food_list">
                    <td>{{item.food_id}}</td>
                    <td>{{item.food_name}}</td>
                    <td>{{item.food_price}}</td>
                    <td>{{item.food_time*1000|date:"yyyy-MM-dd"}}</td>
                    <td>{{item.fcate_name}}</td>
                    <td>
                        <a ui-sref="food_edit({food_id:item.food_id})"><i class="icon-pencil"></i></a>
                        
                        <a href="#myModal" role="button" ng-click="deleteFood(item.food_id)" data-toggle="modal"><i class="icon-remove"></i></a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="pagination">
            <ul uib-pagination total-items="totalItems" ng-model="currentPage" items-per-page="bigTotalItems" max-size="maxSize" ng-change="pageChanged()"></ul>
        </div>

        <div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">Delete Confirmation</h3>
            </div>

            <div class="modal-body">
                <p class="error-text"><i class="icon-warning-sign modal-icon"></i>Are you sure you want to delete the user?</p>
            </div>


            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>

                <button type="button" ui-sref="food_delete({'food_id':food_id})" class="btn btn-danger" data-dismiss="modal">
                Delete</button>
            </div>


        </div>

        <footer>
            <hr>
            <p>&copy; 2017 <a href="#" target="_blank">copyright</a></p>
        </footer>
    </div>
</div>